<template>
  <div>
    <el-tag size="mini" type="success" v-if="type_id === 0" >{{organization_type[scope.row.type_id].type}}</el-tag>
    <el-tag size="mini" type="warning" v-else-if="type_id === 1" >{{organization_type[scope.row.type_id].type}}</el-tag>
    <el-tag size="mini" type="primary" v-else-if="type_id === 2" >{{organization_type[scope.row.type_id].type}}</el-tag>
    <el-tag size="mini" v-else >{{organization_type[type_id].type}}</el-tag>
  </div>
</template>

<script>
export default {
  name: "TypeTag",
  props: ['type_id'],
  data() {
    return {
      organization_type: []
    }
  },
  methods() {
    return {
      initOrganizationType() {
        let that = this
        this.$http.post(this.$conf.baseURL + '/queryAllType')
            .then(function (res){
              that.organization_type = res.data
            })
      },
    }
  },
  created() {
    this.initOrganizationType()
  }
}
</script>

<style scoped>

</style>
